package com.tencet.servlet;/**
 * @author: King
 * @date: 2022/7/25 10:09
 * @description:
 */

import com.tencet.entity.Personal;
import com.tencet.service.Impl.PersonalServiceImpl;
import com.tencet.service.PersonalService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 @author: King
 @date: 2022/7/25 10:09
 @description:

 */
@WebServlet("/updatepersonal")
public class UpdatePersonal extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        String detailed_address = req.getParameter("detailed_address");
        Personal p =new Personal(detailed_address);
        PersonalService personalService2 = new PersonalServiceImpl();
        int update = personalService2.update(p);
        if (update == 0){
            resp.getWriter().write("修改成功");
        }else {
            resp.getWriter().write("修改失败");
        }


    }
}